package com.pomr.dao.sys.impl;


import java.util.List;

import org.springframework.stereotype.Repository;

import com.pomr.dao.base.impl.BaseDaoImpl;
import com.pomr.dao.sys.UerDao;
import com.pomr.model.sys.User;
import com.pomr.util.common.MD5;
@Repository
public class UerDaoImpl extends BaseDaoImpl implements UerDao {

	@Override
	public User getUserOfLogin(User user) throws Exception {
		List<User> list = findByHql("from User u where u.uname='"+user.getUname()+"' and password='"+user.getPassword()+"' and (u.status != '1' or u.status = null)");
		if(list == null || list.size()<=0){
			return null;
		}
		return list.get(0);
	}

	
}
